package edu.scau.divineplace.controller;

import edu.scau.divineplace.config.global.log.WebLog;
import edu.scau.divineplace.entity.vo.CommentScoreVO;
import edu.scau.divineplace.service.CommentScoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @Author: x1aolone
 * @Date: 2020/12/11 15:47
 */
@Slf4j
@RestController
@CrossOrigin
@Api("CommentScore控制器")
@WebLog("CommentScore控制器")
@RequestMapping("/commentScore")
public class CommentScoreController {

    @Autowired
    private CommentScoreService commentScoreService;

    @ApiOperation("通过用户id获取他打的评分，支持分页")
    @GetMapping("/list/{userId}")
    public List<CommentScoreVO> list(@PathVariable Long userId, Integer currentPage, Integer pageSize){
        return commentScoreService.list(userId, currentPage, pageSize);
    }
}
